package com.easylinkin.linkappapi.mechanical.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.easylinkin.linkappapi.circuit.dto.RailGiveAlarmTypeConfigEnum;
import com.easylinkin.linkappapi.circuit.entity.RailGiveAlarmTypeConfig;
import com.easylinkin.linkappapi.common.model.RequestModel;
import com.easylinkin.linkappapi.crane.dto.CraneDTO;
import com.easylinkin.linkappapi.crane.entity.CraneTree;
import com.easylinkin.linkappapi.device.entity.Device;
import com.easylinkin.linkappapi.mechanical.entity.Mechanical;
import com.easylinkin.linkappapi.openapi.dto.DatapushDTO;

import java.util.List;
import java.util.Map;

public interface CraneSafeMonitorService {


    Map<String, Long> todayInfringementLimit();

    List<CraneTree> queryCraneTree();

    void datapushHandler(DatapushDTO datapushDTO);

    Integer generateProtectionAreaAlarm(String tenantId, String platformProjectName, Double threshValue, Device device, Mechanical mechanical, RailGiveAlarmTypeConfig config, RailGiveAlarmTypeConfigEnum typeConfigEnum, String content);

    void triggerAlarm(Device device, Mechanical mechanical, RailGiveAlarmTypeConfigEnum alarmType, RailGiveAlarmTypeConfig config, String content, String platformProjectName);

    void cancelAlarm(Device device, Mechanical mechanical, RailGiveAlarmTypeConfig config);

    void onlineStateChange(Device device, Integer onlineState);

    List<CraneDTO> queryMechanical();

    IPage<CraneDTO> listPage(RequestModel<Mechanical> requestModel);

    void updateDeviceAlarmStatus(Device device);

    Map<String, Object> todayAlarmClassification();

    /**
     * 判断是否有离开区域报警设备
     * @param areaId 区域id
     * @param excludedMechanicalId 排除的机械id
     * @return
     */
    boolean hasLeftAreaAlarmDevice(Long areaId, String excludedMechanicalId);
}

